{include file='../application/index/view/default/header.html' title='修改联系人' userData=$userData }

<style>
        ol,ul li,ul{
            list-style: none;
            padding: 0;
        }
        .breadcrumb{
            height: 45px;
            width: 140px;
            display: inline-block;
            background: #2ebaae;
            text-align: center;
            line-height: 45px;
            margin-bottom: 20px;
            border-radius: 4px;
            color: #fff;
        }
        .breadcrumb:hover{
            color: #fff !important;
        }


        	.add,.edit{
		width: 100%;
		background: #fff;
	}

	.add h3,.edit h3{
		font-size: 22px;
	}

	.add li,.edit li{
		margin-bottom: 15px;
	}

	span.label {
		width: 5%;
		float: left;
		line-height: 44px;
		height: 44px;
	}

	.add input,.edit input{
		width: 95%;
	}

	.add .x, .edit .x {
		position: absolute;
		top: 4%;
		right: 3%;
		width: 30px;
		height: 30px;
		background: url(/static/images/icon_gb.png);
		background-repeat: no-repeat;
		background-size: cover;
	}
    </style>
    <div id="main" class="container padding-top-md text-slg">
        <div class="post clearfix" >
            <div class="clearfix">
                <a class="breadcrumb" href="/index/contacts">通讯录主页</a>
            </div>
            <div class="clearfix add">
                <div class="panel panel-default">
                    <div class="panel-body">
    
    
                            <ul>
                                    <li>
                                        <span class="label">姓名</span>
                                        <input type="text" class="ename" value="{$contactsData.name}">
                                    </li>
                                    <li>
                                        <span class="label">电话</span>
                                        <input type="text" class="etel" value="{$contactsData.tel}">
                                    </li>
                                    <li>
                                        <span class="label">邮箱</span>
                                        <input type="text" class="eemail" value="{$contactsData.email}">
                                    </li>
                                    <li>
                                        <span class="label">地址</span>
                                        <input type="text" class="eaddr" value="{$contactsData.addr}">
                                    </li>
                                    <li>
                                        <span class="label">备注</span>
                                        <input type="text" class="emsg" value="{$contactsData.msg}">
                                    </li>
                                    <li>
                                        <button class="editC" style="    margin: 15px 0;" data-id="{$contactsData.tid}" >修改</button>
                                    </li>
                                </ul>

    
                    </div>
                </div>
            </div>
        </div>
    </div>
    </body>

    <!-- Scripts -->
<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/skel.min.js"></script>
<script src="/static/js/util.js"></script>
<!--[if lte IE 8]><script src="/static/js/ie/respond.min.js"></script><![endif]-->
<script src="/static/js/main.js"></script>

<script>
	$(function(){

        
		$('.editC').on('click',function(){
            $.ajax({
                type:'POST',
                url:'edit',
                dataType:'json',
                data:{'tid':$('.editC').data('id'),'ename':$('.ename').val(),'etel':$('.etel').val(),'eemail':$('.eemail').val(),'eaddr':$('.eaddr').val(),'emsg':$('.emsg').val()},
                success:function(data){
                    alert(data.msg);
                    if(!data.code){
                        window.location.href="/index/contacts";
                    }
                }
            });
        });

	})
</script>

    </html>